package com.wbc.smartHome.dao;


import com.wbc.smartHome.model.HotSpot;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.Date;
import java.util.List;

public interface NewsDao {
/*
    List<HotSpot> newsList(HotSpot news);



    @Update("update news set title=#{title},summary=#{summary},photo=#{photo},typeid=#{typeId},content=#{content},content_type=#{contentType},url=#{url},news_state=#{newsState},adminid=#{adminid},oper_time = now() where id = #{id}")
    void updateNews(HotSpot news);

    @Select("select id,title,summary,photo,typeid,content,content_type,url,news_state from news where id = #{id}")
    HotSpot getNewsById(int id);

    @Delete("delete from news where id = #{id}")
    void delete(int id);

    @Update("update news set news_state=#{state},adminid=#{adminid},oper_time = now() where id = #{id}")
    void updateState(int id, int state,int adminid);


    @Select("select name from news_type order by id asc")
    List<String> newsTypeName();

    @Select("select Count(n.id) from news n right join news_type nt on n.typeid=nt.id group by nt.id")
    List<Integer> newsCount();

    @Select("select Count(n.typeid) from news_type nt left join news n on n.typeid=nt.id and date_format(n.oper_time,'%Y-%m') = #{date} group by nt.id")
    List<Integer> changeImgByDate(Date date);*/
}
